package JasPerl::PageConfig;

use strict;
use warnings;

use JasPerl::Util::Enumeration;
use JasPerl::Util::Exceptions;

sub new {
    my ($class, $name, $context, $params) = @_;
    bless [ $name, $context, $params || { } ], $class;
}

sub get_name {
    return $_[0]->[0];
}

sub get_context {
    return $_[0]->[1];
}

sub get_init_parameter {
    my ($self, $name) = @_;
    JasPerl::Util::NullPointerException->throw()
        unless defined $name;
    return $self->[2]->{$name};
}

sub get_init_parameter_names {
    return JasPerl::Util::Enumeration->from_list(keys %{$_[0]->[2]});
}

1;
